Skip to content

test(sandbox-image): remove the temporary directories tests create - #752

Merged
ian-pascoe merged 1 commit into
mainfrom
fix/test-tmp-cleanup-sandbox-image
Nov 11, 2026
Merged

ian-pascoe merged 1 commit into
mainfrom
fix/test-tmp-cleanup-sandbox-image

Conversation

@ian-pascoe

Copy link
Copy Markdown
Owner

Summary

Each temporary directory a test creates is pushed to a roots list, and a hook removes the list's directories with rmSync(…, { recursive: true, force: true }). Every hook below is afterEach, except the one noted in notify.test.ts:

  • supervisor.test.ts: a new temporaryDirectory(prefix) helper registers the 10 sites (supervise-, gate-, memory-notes-, start-marker-, computerd-store-, earlyoom-, bridge-). They are removed in the existing afterEach, after the report servers are closed.
  • memory-guard.test.ts: the same helper is used for memory-notes-, earlyoom- and go-. They are removed in the existing afterEach, after the guard processes are killed.
  • builds.test.ts: builds- is removed in the existing afterEach, after the started pids are killed with SIGKILL.
  • notify.test.ts: the module-scope build dir cloudpid-notify- is removed in afterAll, and notify-root- in afterEach.
  • comparison.test.ts (comparison-), changes.test.ts (changes-), workspaces.test.ts (workspaces-), toolchains.test.ts (bootstrap-, setup-) and docker.test.ts (cloudpid-dockerd-): a new afterEach, the same as in runs.test.ts.

runs.test.ts and workspaces.ts are unchanged: the first already cleaned up, and the second creates no temporary directories.

Evidence

  • Before: 239 directories left in an isolated TMPDIR after running the 9 files on main
    After: 0

Merge Danger

Door: two-way
Blast Radius: tests-only

@github-actions

Copy link
Copy Markdown

Preview deployed

URL: https://cloudpid-server-pr-752.ian-g-pascoe.workers.dev

Built from c8977da (stage pr-752, behind Access). It is destroyed when the
pull request is closed.


This comment updates on each push.

@ian-pascoe
ian-pascoe merged commit eecbfc0 into main Nov 11, 2026
16 checks passed
@ian-pascoe
ian-pascoe deleted the fix/test-tmp-cleanup-sandbox-image branch November 11, 2026 20:08

This branch was successfully deployed

1 active deployment
preview — 144eb8d7 Deployed Nov 11, 2026 by ian-pascoe via Preview #1383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant